"use strict";
function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./services"));
__export(require("./api"));
__export(require("./realtime"));
__export(require("./functions"));
require("zone.js/dist/zone-node");
require("reflect-metadata");
var core_1 = require("@angular/core");
core_1.enableProdMode();
var framework_1 = require("./framework");
var app_module_1 = require("./app.module");
var install_1 = require("./install");
var cluster = require("cluster");
var os = require("os");
var numCPUs = os.cpus().length;
if (cluster.isMaster) {
    console.log("\u4E3B\u8FDB\u7A0B " + process.pid + " \u6B63\u5728\u8FD0\u884C");
    // 衍生工作进程。
    for (var i = 0; i < numCPUs; i++) {
        cluster.fork();
    }
    cluster.on('exit', function (worker, code, signal) {
        console.log("\u5DE5\u4F5C\u8FDB\u7A0B " + worker.process.pid + " \u5DF2\u9000\u51FA");
    });
}
else {
    framework_1.main({
        base: __dirname,
        port: 3003,
        host: '0.0.0.0',
        app: app_module_1.ApplicationModule,
        install: install_1.InstallModule
    }).subscribe();
}
